package lagouhomework;

import java.util.LinkedList;
import java.util.Scanner;
import java.util.List;

public class addMsg  {


     public void addMsg(List<message> l){

        Scanner sc=new Scanner(System.in);
        message mg=new message();

        System.out.println("请输入新增学生学号");
        mg.setNum(sc.nextInt());
        System.out.println("请输入新增学生姓名");
        mg.setName(sc.next());
        System.out.println("请输入新增学生年龄");
        mg.setAge(sc.nextInt());
        l.add(mg);
    }
}
